<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Java档案管理 - 登录</title>
<!--[if lt IE 9]>
  <script src="libs/html5shiv.min.js"></script>
  <script src="libs/respond.min.js"></script>
  <![endif]-->
<script src="libs/jquery-1.12.1.min.js"></script>
<script type="text/javascript" src="libs/md5.min.js"></script>
<script type="text/javascript" src="libs/jquery.backstretch.min.js"></script>
<link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="col-md-12 page-header">
				<h2 class="text-center">
					Java档案管理<br /> <small>用户登录</small>
				</h2>
			</div>
		</div>
	</div>
	<div class="tp" style="margin-top: 180px">
		<div class="container">
			<div class="row">
				<div class="col-md-4 col-md-offset-4">
					<div class="form-group">
						<label for="account" style="color: white">账号</label> <input
							type="text" class="form-control" id="account" />
					</div>
					<div class="form-group">
						<label for="password" style="color: white">密码</label> <input
							type="password" class="form-control" id="password" />
					</div>
					<button id="login" class="btn btn-primary btn-block">登录</button>
					<button id="register" class="btn btn-primary btn-block">点我</button>
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	$(function() {
		$('#login').click(function() {
			$.post('login.action', {
				account : $('#account').val(),
				password : md5($('#password').val()),
			}, function(res, status) {
				if ('OK' == res) {
					console.log(md5($('#password').val()));
					alert('登录成功')
					window.location.href = 'index.html';
				} else if ('ERR' == res) {
					alert('账户或密码错误');
				}
			});
		});
		$('#register').click(function() {
			window.location.href = 'register.html';
		})
	});
</script>
<script type="text/javascript">
	$.backstretch("20111102150547.jpg")
</script>

</html>
